package com.sweet.logging.logger;

import org.slf4j.Marker;
import org.slf4j.helpers.MarkerIgnoringBase;
import org.slf4j.spi.LocationAwareLogger;

import java.io.Serializable;

/**
 * 适配器，适配 SweetLogger
 *
 * @author xiexiaofeng
 * @version 1.0     2017年09月08日  10点48分
 */
public final class SweetLoggerAdapter extends MarkerIgnoringBase implements LocationAwareLogger, Serializable
{

    private SweetLogger sweetLogger;

    public SweetLoggerAdapter(SweetLogger sweetLogger)
    {
        this.sweetLogger = sweetLogger;
    }

    public void log(Marker marker, String s, int i, String s1, Object[] objects, Throwable throwable)
    {
        // -_-"
    }

    public boolean isTraceEnabled()
    {
        return false;
    }

    public void trace(String s)
    {
        sweetLogger.trace(s);
    }

    public void trace(String s, Object o)
    {
        // 暂不支持
    }

    public void trace(String s, Object o, Object o1)
    {
        // 暂不支持
    }

    public void trace(String s, Object... objects)
    {
        // 暂不支持
    }

    public void trace(String s, Throwable throwable)
    {
        sweetLogger.trace(s, throwable);
    }

    public boolean isDebugEnabled()
    {
        return sweetLogger.enable(LoggingLevel.DEBUG);
    }

    public void debug(String s)
    {
        sweetLogger.debug(s);
    }

    public void debug(String s, Object o)
    {
        // 暂不支持
    }

    public void debug(String s, Object o, Object o1)
    {
        // 暂不支持
    }

    public void debug(String s, Object... objects)
    {
        // 暂不支持
    }

    public void debug(String s, Throwable throwable)
    {
        sweetLogger.debug(s, throwable);
    }

    public boolean isInfoEnabled()
    {
        return sweetLogger.enable(LoggingLevel.INFO);
    }

    public void info(String s)
    {
        sweetLogger.info(s);
    }

    public void info(String s, Object o)
    {
        // 暂不支持
    }

    public void info(String s, Object o, Object o1)
    {
        // 暂不支持
    }

    public void info(String s, Object... objects)
    {
        // 暂不支持
    }

    public void info(String s, Throwable throwable)
    {
        sweetLogger.info(s, throwable);
    }

    public boolean isWarnEnabled()
    {
        return sweetLogger.enable(LoggingLevel.WARN);
    }

    public void warn(String s)
    {
        sweetLogger.warn(s);
    }

    public void warn(String s, Object o)
    {
        // 暂不支持
    }

    public void warn(String s, Object... objects)
    {
        // 暂不支持
    }

    public void warn(String s, Object o, Object o1)
    {
        // 暂不支持
    }

    public void warn(String s, Throwable throwable)
    {
        sweetLogger.warn(s, throwable);
    }

    public boolean isErrorEnabled()
    {
        return sweetLogger.enable(LoggingLevel.ERROR);
    }

    public void error(String s)
    {
        sweetLogger.error(s);
    }

    public void error(String s, Object o)
    {
        // 暂不支持
    }

    public void error(String s, Object o, Object o1)
    {
        // 暂不支持
    }

    public void error(String s, Object... objects)
    {
        // 暂不支持
    }

    public void error(String s, Throwable throwable)
    {
        sweetLogger.error(s, throwable);
    }

}
